import {
    messageBoxAlter
} from "@/func/alter"

import {
    IQueryWorkspace
} from "@/api/fileMgr"

import {
    IQueryDailyNv,
    IQueryStats
} from "@/api/factor"

export async function queryWorkspace (path: string){
    const result = await IQueryWorkspace(path)
    if (result.success){
        return result.data
    }
    else{
        messageBoxAlter("获取目录", result.msg)
        return null
    }
}

export async function queryDailyNv (path: string){
    const result = await IQueryDailyNv(path)
    if (result.success){
        return result.data
    }
    else{
        messageBoxAlter("获取日频绩效", result.msg)
        return null
    }
}

export async function queryStats(path: string) {
    const result = await IQueryStats(path)
    if (result.success){
        return result.data
    }
    else{
        messageBoxAlter("获取因子表现", result.msg)
        return null
    }
}
